package com.bjfu.gmms.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface PhaseMapper {
    // 查询当前阶段的周期值
    @Select("SELECT period FROM phases WHERE college_id = #{collegeId} AND id = #{userId}")
    int getPeriodByCollegeIdAndId(@Param("collegeId") int collegeId, @Param("userId") int userId);

    // 更新指定阶段的周期值
    @Update("UPDATE phases SET period = #{period} WHERE college_id = #{collegeId} AND id = #{userId}")
    int updatePeriodByCollegeAndId(@Param("collegeId")int collegeId,  @Param("userId")int userId, @Param("period")int period);
}
